package com.atguigu.yygh.oss.controller;

import com.atguigu.yygh.oss.service.FileService;
import com.atguigu.yygh.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * zz: wzh
 * time 2022 09 08 20 28
 **/
@RestController
@RequestMapping("/api/oss/file")
public class FileApiController {
    @Autowired
    private FileService fileService;
    @PostMapping("fileUpload")
    public Result fileUpload(MultipartFile multipartFile){
            String url=fileService.upload(multipartFile);
            return Result.ok(url);
    }
}
